home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 0195.ZIP / GETSETDD.LIB < prev    next >
Text File  |  1984-12-03  |  983b  |  34 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2. The purchaser of these procedures and functions may include them in COMPILED
  3. programs freely, but may not sell or give away the source text.
  4.  
  5.    INPUT  : "Activity" is [G]et or [S]et default drive, "drive" is simply
  6.             the drive letter.
  7.  
  8.    NOTE that any program that INCLUDEs this file MUST also include the
  9.    type declarations contained in REGPACK.TYP
  10. }
  11.  
  12. procedure GetSetDrive( activity :char; VAR drive : char);
  13. var
  14.   drivenum  : byte;
  15.   registers : regpack;
  16.  
  17. begin
  18.   activity := UpCase(activity);
  19.   case activity of
  20.     'G': registers.ax := $19 shl 8;
  21.     'S': begin
  22.            registers.ax := $E shl 8;
  23.            drive := UpCase(drive);
  24.            registers.dx := ord(drive) - 65;
  25.          end;
  26.   end; {case}
  27.   MSDOS(registers);
  28.   if activity = 'G' then
  29.     begin
  30.       drivenum := registers.ax and $00FF;
  31.       drive := chr(drivenum + 65);
  32.     end;
  33. end;
  34.